#include <deque>
#include<iostream>
using namespace std;

void printdeque(deque<int> &d) //以引用的方式传进来
{
    for (deque<int>::iterator it = d.begin(); it != d.end(); it++) {
        cout << *it << " ";
    }
} //现在这种状态是可读可写的操作，比如添加一个*it=多少的赋值操作eg.*it = 100; , 此时全部值更换为100,如何避免呢？做到只读？

void printdeques(const deque<int> &d) {
    for (deque<int>::const_iterator it = d.begin(); it != d.end(); it++) //加const
    {
        cout << *it << " ";
    }
}


void test01() {
    deque<int> d1;
    for (int i = 0; i < 10; i++) {
        d1.push_back(i);
    }
    printdeque(d1);
    printdeques(d1);
}

int main() {
    test01();
    return 0;
}